home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991 …esperately Seeking Seven / Desperately Seeking Seven.2mg / Dev.CD.8 / Essentials / Tools / DTS.Samples / SC18AccessPriv / AP.c next >
Encoding:
C/C++ Source or Header  |  1990-05-25  |  2.2 KB  |  59 lines  |  [04] ASCII Text (0x0000)

  1. /***********************************************************************
  2. *
  3. * Access Privilges -- Version 3.0  (Main Program)
  4. *
  5. * Copyright (c)
  6. * Apple Computer, Inc.  1989-1990
  7. * All Rights Reserved.
  8. *
  9. * Developer Technical Support Apple II Sample Code
  10. *
  11. * This program demonstrates issuing calls to the AppleShare File System
  12. * Translator (AppleShare FST). The calls, in in the uWindow.c file, include
  13. * Get Privileges, Set Privileges, and User Info. Other new system features
  14. * utilized in this  program include resources, the Standard File MultiGet2
  15. * call for getting a folder selection from a user, static text controls with
  16. * programmable substitution text, and use of the window manager ErrorWindow
  17. * routine with GS/OS and toolbox calls.The workings of the program are mostly
  18. * contained in the CurrentPrivs, NewPrivs, and ChooseFolder routines in the
  19. * uWindow.c file, and the subroutines they call. Also, this program is
  20. * adapted from the busy box sample application which features calls to
  21. * NewWindow2 and the newly enhanced TaskMaster.
  22. *
  23. * Developers wishing to see future Apple II network sample code in languages
  24. * other than C should voice their preference to Apple II Developer Tech Support.
  25. *
  26. ***********************************************************************/
  27.  
  28. #include <types.h>
  29. #include <quickdraw.h>
  30. #include <locator.h>
  31. #include <resources.h>
  32. #include <memory.h>
  33.  
  34. extern unsigned int    userID;
  35.  
  36. main()
  37. {
  38.     Ref     initRef;     /* This holds the reference to the startstop record */
  39.  
  40.     initGlobals();       /* Initialize our globals. */
  41.  
  42.     userID = MMStartUp();   /* Start up and get ID from memory manager */
  43.     TLStartUp();                /* Start up the tool locator */
  44.  
  45.     /* Startup the tools using the new toolbox call */
  46.     initRef = StartUpTools(userID, refIsResource, 0x0001L);
  47.     if (!_toolErr) {
  48.         setUpMenus();    /* Set up menus */
  49.         setupWindows();
  50.         setupCtrls();
  51.         InitCursor();    /* Make cursor show ready */
  52.         mainEvent();     /* Use application */
  53.     }
  54.  
  55.     ShutDownTools(refIsHandle, initRef);
  56.         /* Let the toolbox shutdown the tools. */
  57.     TLShutDown();                          /* Shut down the tool locator */
  58. }
  59.